SOURCEFILE = powermodel
CLEANFILES = *.bbl *.blg *.fmt *.aux *.log _*.prv *.out *.nav *.snm *.dvi *.toc *.lof *.idx *.lot *.synctex
TARGET = $(SOURCEFILE:.tex=.pdf)

.PHONY: all
all:$(TARGET)

$(TARGET):
	pdflatex $(SOURCEFILE)
	bibtex $(SOURCEFILE)
	pdflatex $(SOURCEFILE)
	bibtex $(SOURCEFILE)
	bibtex $(SOURCEFILE)
	pdflatex $(SOURCEFILE)
	pdflatex $(SOURCEFILE)

.PHONY: clean
clean:
	rm -rf $(CLEANFILES) $(SOURCEFILE).pdf

.PHONY: distclean
distclean:
	rm -rf $(CLEANFILES) $(TARGET)
